package terminals;


import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import connectionSettings.BTSerialConnectionSettings;
import connectionSettings.ConnectionSettings;
import connections.Connection;


public class BTSerialTerminal extends MIDlet  {

	public BTSerialConnectionSettings myForm;
	

	protected void startApp() throws MIDletStateChangeException {

		myForm = new BTSerialConnectionSettings(Display.getDisplay(this));
		myForm.addMIDlet(this);
		myForm.setDelimitationStyle(ConnectionSettings.DELIMITATION_NONE);
		myForm.setNeedToRequestData(false);
		//myForm.setDiscoverServices(true);
	}
	
	protected void pauseApp() {
		// TODO Auto-generated method stub
		
	}


	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		// TODO Auto-generated method stub
		System.out.println("Destroy is Disconnecting");
		Connection myConnection = myForm.getConnection();
		if (myConnection != null) myConnection.disconnect();
		notifyDestroyed();
	}












}
